import cv2 as cv
import numpy as np

filePath = '../test_datas/jWithWhiteNoiseLeft.png'
img = cv.imread(filePath, 0)
kernel = np.ones((5, 5), np.uint8)

opening = cv.morphologyEx(img, cv.MORPH_OPEN, kernel)

cv.imshow('img', img)
cv.imshow('opening', opening)

cv.waitKey(0)
cv.destroyAllWindows()